<?php
/**
 * Created by PhpStorm.
 * User: pankajmishra
 * Date: 20/12/14
 * Time: 11:49 AM
 */

namespace ApplicationTest;

use Application\Model\Dao\GraphDao;
use Application\Model\Dao\UserDao;
use Application\Service\XmlService;
use Zend\Config\Reader\Xml;
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase;


class GraphDaoTest /*extends AbstractHttpControllerTestCase*/
{
    public function setUp()
    {
        $this->setApplicationConfig(
            include '/Users/pankajmishra/source/myproj/bhaibandhu/config/application.config.php'
        );
        parent::setUp();
    }


    public function testAddEdge(){
        date_default_timezone_set('UTC');
        $graphDao = new GraphDao();
        $graphDao->saveEdge(array(
            'timestamp' => array('type' => 'date', 'val' => date( 'Y-m-d H:i:s', time() ))
        ),'Friend',array('id'=>1),array('id'=>5));
    }



/*
    public function testAddNode()
    {
        $graphDao = new GraphDao();
        date_default_timezone_set('UTC');
        $graphDao->saveNode(array(
            'date' => array('type' => 'date', 'val' => date( 'Y-m-d H:i:s', time() )),
            'name' => 'datea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdf
            datea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdf
            datea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdf
            datea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdfdatea asdf sdf sdf s df
            sdfsdf sdf sd f sdf sd f sdf sd f
            sdf sdfsdf
            sdf
            sdf sdf sdf sdf sd fsdf
            sdf
            sd
            f
            sdf'
        ));
        // $userDao->saveUser('pankaj', 'mishraawake@gmail.com','abc123');
        echo "ds";
    }
*/

    /*
    public function testGetNode()
    {
        $graphDao = new GraphDao();
        $graphDao->getNode(34);
        // $userDao->saveUser('pankaj', 'mishraawake@gmail.com','abc123');
        echo "ds";
    }

*/


    public function testGetChildren()
    {
        $graphDao = new GraphDao();
        echo "start -----";
        var_dump($graphDao->getChildrenWithLabel(1,'node_from', 'Follow')) ;
        echo "end -----";
        // $userDao->saveUser('pankaj', 'mishraawake@gmail.com','abc123');
        echo "ds";
    }


}

